<?php
$db = new SQLite3("students.db");
$data = json_decode($_POST["ajax"], true);
$stmt = $db->prepare("insert into grades values(:stu_id, :cou_id, :grade)");
$stmt->bindValue(":stu_id", $data["stu_id"], SQLITE3_TEXT);
$stmt->bindValue(":cou_id", $data["cou_id"], SQLITE3_TEXT);
$stmt->bindValue(":grade", $data["grade"], SQLITE3_INTEGER);
$stmt->execute();
echo "ok";
?>